Integrand size = 40, antiderivative size = 171 \[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2 (3 b B+a C) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 \left (a^2-b^2\right ) C \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 b d \sqrt {a+b \cos (c+d x)}}+\frac {2 C \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 d} \]
2/3*C*sin(d*x+c)*(a+b*cos(d*x+c))^(1/2)/d+2/3*(3*B*b+C*a)*(cos(1/2*d*x+1/2 *c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2)*(b/(a +b))^(1/2))*(a+b*cos(d*x+c))^(1/2)/b/d/((a+b*cos(d*x+c))/(a+b))^(1/2)-2/3* (a^2-b^2)*C*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticF(sin( 1/2*d*x+1/2*c),2^(1/2)*(b/(a+b))^(1/2))*((a+b*cos(d*x+c))/(a+b))^(1/2)/b/d /(a+b*cos(d*x+c))^(1/2)
Time = 0.81 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.85 \[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2 (a+b) (3 b B+a C) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-2 \left (a^2-b^2\right ) C \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )+2 b C (a+b \cos (c+d x)) \sin (c+d x)}{3 b d \sqrt {a+b \cos (c+d x)}} \]
(2*(a + b)*(3*b*B + a*C)*Sqrt[(a + b*Cos[c + d*x])/(a + b)]*EllipticE[(c + d*x)/2, (2*b)/(a + b)] - 2*(a^2 - b^2)*C*Sqrt[(a + b*Cos[c + d*x])/(a + b )]*EllipticF[(c + d*x)/2, (2*b)/(a + b)] + 2*b*C*(a + b*Cos[c + d*x])*Sin[ c + d*x])/(3*b*d*Sqrt[a + b*Cos[c + d*x]])
Time = 0.95 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.01, number of steps used = 14, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {3042, 3508, 3042, 3232, 27, 3042, 3231, 3042, 3134, 3042, 3132, 3142, 3042, 3140}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec (c+d x) \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )} \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \sqrt {a+b \cos (c+d x)} (B+C \cos (c+d x))dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )} \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 3232 |
\(\displaystyle \frac {2}{3} \int \frac {3 a B+b C+(3 b B+a C) \cos (c+d x)}{2 \sqrt {a+b \cos (c+d x)}}dx+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{3} \int \frac {3 a B+b C+(3 b B+a C) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}}dx+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \int \frac {3 a B+b C+(3 b B+a C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3231 |
\(\displaystyle \frac {1}{3} \left (\frac {(a C+3 b B) \int \sqrt {a+b \cos (c+d x)}dx}{b}-\frac {C \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}}dx}{b}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {(a C+3 b B) \int \sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b}-\frac {C \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )}}dx}{b}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3134 |
\(\displaystyle \frac {1}{3} \left (\frac {(a C+3 b B) \sqrt {a+b \cos (c+d x)} \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}dx}{b \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {C \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )}}dx}{b}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {(a C+3 b B) \sqrt {a+b \cos (c+d x)} \int \sqrt {\frac {a}{a+b}+\frac {b \sin \left (c+d x+\frac {\pi }{2}\right )}{a+b}}dx}{b \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {C \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )}}dx}{b}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3132 |
\(\displaystyle \frac {1}{3} \left (\frac {2 (a C+3 b B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {C \left (a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \sin \left (c+d x+\frac {\pi }{2}\right )}}dx}{b}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3142 |
\(\displaystyle \frac {1}{3} \left (\frac {2 (a C+3 b B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {C \left (a^2-b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}}dx}{b \sqrt {a+b \cos (c+d x)}}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {2 (a C+3 b B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {C \left (a^2-b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \sin \left (c+d x+\frac {\pi }{2}\right )}{a+b}}}dx}{b \sqrt {a+b \cos (c+d x)}}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
\(\Big \downarrow \) 3140 |
\(\displaystyle \frac {1}{3} \left (\frac {2 (a C+3 b B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{b d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 C \left (a^2-b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{b d \sqrt {a+b \cos (c+d x)}}\right )+\frac {2 C \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 d}\) |
((2*(3*b*B + a*C)*Sqrt[a + b*Cos[c + d*x]]*EllipticE[(c + d*x)/2, (2*b)/(a + b)])/(b*d*Sqrt[(a + b*Cos[c + d*x])/(a + b)]) - (2*(a^2 - b^2)*C*Sqrt[( a + b*Cos[c + d*x])/(a + b)]*EllipticF[(c + d*x)/2, (2*b)/(a + b)])/(b*d*S qrt[a + b*Cos[c + d*x]]))/3 + (2*C*Sqrt[a + b*Cos[c + d*x]]*Sin[c + d*x])/ (3*d)
3.9.16.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[2*(Sqrt[a + b]/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2*(b/(a + b))], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]
Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[Sqrt[a + b*Sin[c + d*x]]/Sqrt[(a + b*Sin[c + d*x])/(a + b)] Int[Sqrt[a/(a + b) + ( b/(a + b))*Sin[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2 , 0] && !GtQ[a + b, 0]
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/(d*S qrt[a + b]))*EllipticF[(1/2)*(c - Pi/2 + d*x), 2*(b/(a + b))], x] /; FreeQ[ {a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[Sqrt[(a + b*Sin[c + d*x])/(a + b)]/Sqrt[a + b*Sin[c + d*x]] Int[1/Sqrt[a/(a + b) + (b/(a + b))*Sin[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && !GtQ[a + b, 0]
Int[((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*sin[(e_.) + ( f_.)*(x_)]], x_Symbol] :> Simp[(b*c - a*d)/b Int[1/Sqrt[a + b*Sin[e + f*x ]], x], x] + Simp[d/b Int[Sqrt[a + b*Sin[e + f*x]], x], x] /; FreeQ[{a, b , c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[1/(m + 1) Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[b* d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ [{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(599\) vs. \(2(213)=426\).
Time = 11.02 (sec) , antiderivative size = 600, normalized size of antiderivative = 3.51
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (4 C \left (\cos ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+3 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b -3 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) b^{2}+2 C \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -6 C \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}+C \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}-C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b -2 C \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) a b +2 C \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}\right )}{3 b \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b}\, d}\) | \(600\) |
parts | \(-\frac {2 B \sqrt {\left (2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) \left (a -b \right )}{\sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b}\, d}-\frac {2 C \sqrt {\left (2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (4 \left (\cos ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+2 \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -6 \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-a^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}-\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b -2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) a b +2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}\right )}{3 b \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b}\, d}\) | \(624\) |
-2/3*((2*b*cos(1/2*d*x+1/2*c)^2+a-b)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(4*C*cos( 1/2*d*x+1/2*c)^5*b^2+3*B*(sin(1/2*d*x+1/2*c)^2)^(1/2)*((2*b*cos(1/2*d*x+1/ 2*c)^2+a-b)/(a-b))^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),(-2*b/(a-b))^(1/2))* a*b-3*B*(sin(1/2*d*x+1/2*c)^2)^(1/2)*((2*b*cos(1/2*d*x+1/2*c)^2+a-b)/(a-b) )^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),(-2*b/(a-b))^(1/2))*b^2+2*C*cos(1/2*d *x+1/2*c)^3*a*b-6*C*cos(1/2*d*x+1/2*c)^3*b^2-C*(sin(1/2*d*x+1/2*c)^2)^(1/2 )*((2*b*cos(1/2*d*x+1/2*c)^2+a-b)/(a-b))^(1/2)*EllipticF(cos(1/2*d*x+1/2*c ),(-2*b/(a-b))^(1/2))*a^2+C*b^2*(sin(1/2*d*x+1/2*c)^2)^(1/2)*((2*b*cos(1/2 *d*x+1/2*c)^2+a-b)/(a-b))^(1/2)*EllipticF(cos(1/2*d*x+1/2*c),(-2*b/(a-b))^ (1/2))+C*(sin(1/2*d*x+1/2*c)^2)^(1/2)*((2*b*cos(1/2*d*x+1/2*c)^2+a-b)/(a-b ))^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),(-2*b/(a-b))^(1/2))*a^2-C*(sin(1/2*d *x+1/2*c)^2)^(1/2)*((2*b*cos(1/2*d*x+1/2*c)^2+a-b)/(a-b))^(1/2)*EllipticE( cos(1/2*d*x+1/2*c),(-2*b/(a-b))^(1/2))*a*b-2*C*cos(1/2*d*x+1/2*c)*a*b+2*C* cos(1/2*d*x+1/2*c)*b^2)/b/(-2*sin(1/2*d*x+1/2*c)^4*b+(a+b)*sin(1/2*d*x+1/2 *c)^2)^(1/2)/sin(1/2*d*x+1/2*c)/(-2*b*sin(1/2*d*x+1/2*c)^2+a+b)^(1/2)/d
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.11 (sec) , antiderivative size = 435, normalized size of antiderivative = 2.54 \[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {6 \, \sqrt {b \cos \left (d x + c\right ) + a} C b^{2} \sin \left (d x + c\right ) + \sqrt {2} {\left (2 i \, C a^{2} - 3 i \, B a b - 3 i \, C b^{2}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + \sqrt {2} {\left (-2 i \, C a^{2} + 3 i \, B a b + 3 i \, C b^{2}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) - 3 \, \sqrt {2} {\left (-i \, C a b - 3 i \, B b^{2}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) - 3 \, \sqrt {2} {\left (i \, C a b + 3 i \, B b^{2}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right )}{9 \, b^{2} d} \]
integrate((a+b*cos(d*x+c))^(1/2)*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c), x, algorithm="fricas")
1/9*(6*sqrt(b*cos(d*x + c) + a)*C*b^2*sin(d*x + c) + sqrt(2)*(2*I*C*a^2 - 3*I*B*a*b - 3*I*C*b^2)*sqrt(b)*weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2 , -8/27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) + 3*I*b*sin(d*x + c) + 2*a)/b) + sqrt(2)*(-2*I*C*a^2 + 3*I*B*a*b + 3*I*C*b^2)*sqrt(b)*weierstra ssPInverse(4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b* cos(d*x + c) - 3*I*b*sin(d*x + c) + 2*a)/b) - 3*sqrt(2)*(-I*C*a*b - 3*I*B* b^2)*sqrt(b)*weierstrassZeta(4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*a^3 - 9*a*b ^2)/b^3, weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*a^3 - 9*a*b ^2)/b^3, 1/3*(3*b*cos(d*x + c) + 3*I*b*sin(d*x + c) + 2*a)/b)) - 3*sqrt(2) *(I*C*a*b + 3*I*B*b^2)*sqrt(b)*weierstrassZeta(4/3*(4*a^2 - 3*b^2)/b^2, -8 /27*(8*a^3 - 9*a*b^2)/b^3, weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2, -8 /27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) - 3*I*b*sin(d*x + c) + 2* a)/b)))/(b^2*d)
\[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \left (B + C \cos {\left (c + d x \right )}\right ) \sqrt {a + b \cos {\left (c + d x \right )}} \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \]
\[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sec \left (d x + c\right ) \,d x } \]
integrate((a+b*cos(d*x+c))^(1/2)*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c), x, algorithm="maxima")
\[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sec \left (d x + c\right ) \,d x } \]
integrate((a+b*cos(d*x+c))^(1/2)*(B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c), x, algorithm="giac")
Timed out. \[ \int \sqrt {a+b \cos (c+d x)} \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \frac {\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )\right )\,\sqrt {a+b\,\cos \left (c+d\,x\right )}}{\cos \left (c+d\,x\right )} \,d x \]